/*
 * Copyright 2010-2011 Sanjay Dwivedi.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.isdinvestments.cam.domain.model;

import java.io.Serializable;
import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;


/**
 * The persistent class for the POSITION_SNAPSHOT database table.
 * 
 */
@Entity
@Table(name="POSITION_SNAPSHOT")
public class PositionSnapshot implements Serializable {
	private static final long serialVersionUID = 1L;

	@EmbeddedId
	private PositionSnapshotPK id;

	@Column(name="ASSET_UNITS")
	private BigDecimal assetUnits;

	@Column(name="AVERAGE_UNIT_PURCHASE_PRICE")
	private BigDecimal averageUnitPurchasePrice;

	@Column(name="CREATED_BY")
	private String createdBy;

    @Temporal( TemporalType.DATE)
	@Column(name="CREATED_DATE")
	private Date createdDate;

	private String name;

	@Column(name="UPDATED_BY")
	private String updatedBy;

    @Temporal( TemporalType.DATE)
	@Column(name="UPDATED_DATE")
	private Date updatedDate;

	//bi-directional many-to-one association to Event
    @ManyToOne
	private Event event;

	//bi-directional many-to-one association to ReferenceData
    @ManyToOne
	@JoinColumn(name="STATUS")
	private PositionStatus positionStatus;

	//bi-directional many-to-one association to ReferenceData
    @ManyToOne
	@JoinColumn(name="POSITION_TYPE")
	private PositionType positionType;

    public PositionSnapshot() {
    }

	public PositionSnapshotPK getId() {
		return this.id;
	}

	public void setId(PositionSnapshotPK id) {
		this.id = id;
	}
	
	public BigDecimal getAssetUnits() {
		return this.assetUnits;
	}

	public void setAssetUnits(BigDecimal assetUnits) {
		this.assetUnits = assetUnits;
	}

	public BigDecimal getAverageUnitPurchasePrice() {
		return this.averageUnitPurchasePrice;
	}

	public void setAverageUnitPurchasePrice(BigDecimal averageUnitPurchasePrice) {
		this.averageUnitPurchasePrice = averageUnitPurchasePrice;
	}

	public String getCreatedBy() {
		return this.createdBy;
	}

	public void setCreatedBy(String createdBy) {
		this.createdBy = createdBy;
	}

	public Date getCreatedDate() {
		return this.createdDate;
	}

	public void setCreatedDate(Date createdDate) {
		this.createdDate = createdDate;
	}

	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getUpdatedBy() {
		return this.updatedBy;
	}

	public void setUpdatedBy(String updatedBy) {
		this.updatedBy = updatedBy;
	}

	public Date getUpdatedDate() {
		return this.updatedDate;
	}

	public void setUpdatedDate(Date updatedDate) {
		this.updatedDate = updatedDate;
	}

	public Event getEvent() {
		return this.event;
	}

	public void setEvent(Event event) {
		this.event = event;
	}
	
	public PositionStatus getPositionStatus() {
		return this.positionStatus;
	}

	public void setPositionStatus(PositionStatus status) {
		this.positionStatus = status;
	}
	
	public PositionType getPositionTYpe() {
		return this.positionType;
	}

	public void setPositionType(PositionType type) {
		this.positionType = type;
	}
	
}